package com.artisan.domain.repositoryInterface;

import com.artisan.domain.entity.MAccount;
import com.querydsl.core.Tuple;
import com.querydsl.core.types.Predicate;
import com.querydsl.jpa.impl.JPAQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 账户数据访问接口
 */
@Repository
public interface IAccountRepository extends JpaRepository<MAccount, Integer>, QuerydslPredicateExecutor<MAccount> {
    @Query(value = "select c from MAccount c " +
            " where c.userName=:name order by c.addDate desc ")
    Page<MAccount> find(@Param("name") String name, Pageable pageable);

}
